//成员列表分页展示
import request from '@/utils/request'
function getMemberList (params) {
  return $axios({
    url: '/employee/page',
    method: 'get',
    params
  })
}

// 修改---启用禁用接口
function enableOrDisableEmployee (params) {
  return $axios({
    url: '/employee',
    method: 'put',
    data: { ...params }
  })
}

// 新增---添加学生
function addEmployee (params) {
  return $axios({
    url: '/employee',
    method: 'post',
    data: { ...params }
  })
}

// 修改---添加员工
function editEmployee (params) {
  return $axios({
    url: '/employee',
    method: 'put',
    data: { ...params }
  })
}

// 修改页面反查详情接口
function queryEmployeeById (id) {
  return $axios({
    url: `/employee/${id}`,
    method: 'get'
  })
}
function importClass(id, formData) {
  return $axios({
    url: `/time/${id}`,
    method: 'post',
    data: formData, // 将FormData对象作为请求体发送给后端
    headers: {
      'Content-Type': 'multipart/form-data' // 设置请求头为multipart/form-data
    }
  });
}

// 进行课表的删除操作
function deteleClass (id) {
  return $axios({
    url: `/time/deteleClass/${id}`,
    method: 'post'
  })
}

//进行用户的删除操作
function detele (id) {
  return $axios({
    url: `/time/deteleUser/${id}`,
    method: 'post'
  })
}
//按钮点击后的操作
function fetchScheduleData (studyId,dayOfWeek,num) {
  return $axios({
    headers: { 'Content-Type': 'application/json; charset=UTF-8' },
    url: `/signIn/selectUpClass/${studyId}/${dayOfWeek}/${num}`,
    method: 'get'
  })
}
//进行课表的查询(往前端放)的操作
// function selectClass (studyId) {
//   return $axios({
//     headers: { 'Content-Type': 'application/json; charset=UTF-8' },
//     url: `/signIn/selectClass/${studyId}`,
//     method: 'get'
//   })
// }
// export function selectClass() {
//   return request({
//     url: '/signIn/member/selectClass',
//     method: 'get',
//   })
// }
//教师提交材料历史总表
export function selectClass() {
  return request({
    url: `/admservice/timesystem/selectClass`,
    method: 'get'
  })
}
export function selectTime() {
  return request({
    url: `/admservice/timesystem/selectTime`,
    method: 'get'
  })
}
//进行签到情况的分页查看
function getStudentSign (params) {
  return $axios({
    url: '/look/sign',
    method: 'get',
    params
  })
}
//进行迟到学生的分页查询
function getStudentLate (params) {
  return $axios({
    url: '/look/late',
    method: 'get',
    params
  })
}
//进行代签
function signOnBehalf (id) {
  return $axios({
    url: `/look/signOnBehalf/${id}`,
    method: 'post'
  })
}
//进行未签到学生的分页查询
function getStudentNoSign (params) {
  return $axios({
    url: '/look/noSign',
    method: 'get',
    params
  })
}

// 修改时间
function updateTimeTable (params) {
  return $axios({
    url: '/look/update',
    method: 'put',
    data: { ...params }
  })
}
//查询所有的课
function getAllClass (params) {
  return $axios({
    url: '/look/allClass',
    method: 'get',
    params
  })
}
//删除要修改的课
function modifyClass (id) {
  return $axios({
    url: `/look/modifyClass/${id}`,
    method: 'post'
  })
}
//新增课表
function addClass (params) {
  return $axios({
    url: '/look/add',
    method: 'post',
    data: { ...params }
  })
}
//获取所有时间段
function getAllTime (params) {
  return $axios({
    url: '/look/allTime',
    method: 'get',
    params
  })
}
// //进行时间的查询(往前端放)的操作
// function selectTime () {
//   return $axios({
//     headers: { 'Content-Type': 'application/json; charset=UTF-8' },
//     url: `/signIn/selectTime`,
//     method: 'get'
//   })
// }
//点击提交后获得对应的id
function updateClassTimes (id,start,middle,end) {
  return $axios({
    url: `/signIn/updateTime/${id}/${start}/${middle}/${end}`,
    method: 'post'
  })
}
//修改开学时间
function updateStartTime (data) {
  return $axios({
    url: `/signIn/updateStart/${data}`,
    method: 'post'
  })
}
